package com.kehao.netease;

import java.util.Scanner;

public class Q2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] s = sc.nextLine().split(" ");
        int[] arr = new int[s.length];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = Integer.parseInt(s[i]);
        }
        int result = 0;
        int left =0,right =0;
        for (int i = 0; i < arr.length; i++) {
            if(arr[i]==0){
                if(i>0){
                    if(arr[i-1]==0){
                        left++;
                        right--;
                    }else {
                        left = 0;
                        right = 0;
                        int j = i+1;
                        while (j<arr.length&&arr[j] == 0){
                            right++;
                            j++;
                        }
                    }
                }else {
                    left = 0;
                    right = 0;
                    int j = i+1;
                    while (j<arr.length&&arr[j] == 0){
                        right++;
                        j++;
                    }
                }
                result = Integer.max(result,Integer.min(left,right));
            }
        }
        System.out.println(result+1);
    }
}
